package jsyf.oa.service.report;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.dao.system.UserDao;
import jsyf.oa.dao.system.UserDescDao;
import jsyf.oa.facade.report.UserReportFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2018/1/23 0023.
 */
@Service
@com.alibaba.dubbo.config.annotation.Service(protocol = {"dubbo"})
public class UserReportService implements UserReportFacade {
    @Autowired
    private UserDao userDao;
    @Autowired
    private UserDescDao userDescDao;

    @Override
    public JSONObject getByUserId(String userId) {
        JSONObject result = new JSONObject();
        JSONObject users = userDao.getViewJSONById(userId);
        List<JSONObject> userDesc = userDescDao.getJSONListByCondition(" and USER_ID=?", new Object[]{userId});
        result.put("user",users);
        result.put("userDesc",userDesc);
        return result;
    }
}
